package com.billion.payment.service;

import com.alibaba.fastjson.JSONObject;
import com.billion.payment.entity.ali.AliOrderEntity;
import com.billion.payment.entity.ali.AliPayEntity;
import com.billion.payment.entity.ali.AliRefundEntity;

/**
 * @author 王琦
 *
 * @date 2021/12/17
 */
public interface IAlipayService {

    /**
     * 统一下单
     * @param aliOrderEntity
     * @return
     */
    JSONObject order(AliOrderEntity aliOrderEntity);

    /**
     * 支付
     * @param aliPayEntity
     * @return
     */
    JSONObject pay(AliPayEntity aliPayEntity);

    /**
     * 退费
     * @param aliRefundEntity
     en@return
     */
    JSONObject refund(AliRefundEntity aliRefundEntity);

    /**
     * 获取支付宝openid
     * @param appId
     * @param privateKey
     * @param code
     * @return
     */
    String getOpenId(String appId, String privateKey, String publicKey, String code);
}
